<?php
$uname = '';
if(isset($_REQUEST['txt_username'])){
	$uname = $_REQUEST['txt_username'];
	include("inc/class.otr.php");
	$otr = new OTR();
	$return = $otr->validateLogin($uname, $_REQUEST['txt_password']);
	if($return['result']=='FALSE'){
		echo($return['msg']);
	} else {
		echo("<script type='text/javascript'>ajaxGet('menu.php', null, $('leftPanel'), null)</script>");
	}
}
?>
<form name="frmlogin" id="frmlogin" method="post" action="login.php">
<div style="padding: 10px;">
User name:<br/>
<input type="text" id="txt_username" name="txt_username" value="<?php echo($uname);?>" /><br/>
Password:<br/>
<input type="password" id="txt_password" name="txt_password" /><br/><br/>
<input type="button" value="login" onclick="doSubmit();"/>
</div>
</form>
<script type="text/javascript">
	var doSubmit = function(){
		ajaxPost($('frmlogin'), 'login.php', $('leftPanel'));
	}
</script>